package com.knowledge.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
        import com.knowledge.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.knowledge.business.mapper.TMemberLevelMapper;
import com.knowledge.business.domain.TMemberLevel;
import com.knowledge.business.service.ITMemberLevelService;

/**
 * 用户等级Service业务层处理
 *
 * @author zhaoyk
 * @date 2025-09-17
 */
@Service
public class TMemberLevelServiceImpl extends ServiceImpl<TMemberLevelMapper,TMemberLevel>  implements ITMemberLevelService
{
    @Autowired
    private TMemberLevelMapper tMemberLevelMapper;

    /**
     * 查询用户等级
     *
     * @param id 用户等级主键
     * @return 用户等级
     */
    @Override
    public TMemberLevel selectTMemberLevelById(String id)
    {
        return tMemberLevelMapper.selectTMemberLevelById(id);
    }

    /**
     * 查询用户等级列表
     *
     * @param tMemberLevel 用户等级
     * @return 用户等级
     */
    @Override
    public List<TMemberLevel> selectTMemberLevelList(TMemberLevel tMemberLevel)
    {
        return tMemberLevelMapper.selectTMemberLevelList(tMemberLevel);
    }

    /**
     * 新增用户等级
     *
     * @param tMemberLevel 用户等级
     * @return 结果
     */
    @Override
    public int insertTMemberLevel(TMemberLevel tMemberLevel)
    {
                tMemberLevel.setCreateTime(DateUtils.getNowDate());
            return tMemberLevelMapper.insertTMemberLevel(tMemberLevel);
    }

    /**
     * 修改用户等级
     *
     * @param tMemberLevel 用户等级
     * @return 结果
     */
    @Override
    public int updateTMemberLevel(TMemberLevel tMemberLevel)
    {
                tMemberLevel.setUpdateTime(DateUtils.getNowDate());
        return tMemberLevelMapper.updateTMemberLevel(tMemberLevel);
    }

    /**
     * 批量删除用户等级
     *
     * @param ids 需要删除的用户等级主键
     * @return 结果
     */
    @Override
    public int deleteTMemberLevelByIds(String[] ids)
    {
        return tMemberLevelMapper.deleteTMemberLevelByIds(ids);
    }

    /**
     * 删除用户等级信息
     *
     * @param id 用户等级主键
     * @return 结果
     */
    @Override
    public int deleteTMemberLevelById(String id)
    {
        return tMemberLevelMapper.deleteTMemberLevelById(id);
    }
}
